﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;

namespace Microformats
{
    public class Utility
    {
        public static Dictionary<string, string> GetCountries()
        {
            Dictionary<string, string> cultureList = new Dictionary<string, string>();

            CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures & ~CultureTypes.NeutralCultures);

            foreach (CultureInfo culture in cultures.OrderBy(q => q.EnglishName))
            {
                RegionInfo region = new RegionInfo(culture.LCID);

                if (!(cultureList.ContainsKey(region.TwoLetterISORegionName)))
                {
                    cultureList.Add(region.TwoLetterISORegionName, region.EnglishName);
                }
            }

            return cultureList;
        }

        public static Dictionary<string, string> GetStates()
        {
            Dictionary<string, string> dictStates = new Dictionary<string, string>();
            dictStates.Add("AK", "Alaska");
            dictStates.Add("AL", "Alabama");
            dictStates.Add("AR", "Arkansas");
            dictStates.Add("AZ", "Arizona");
            dictStates.Add("CA", "California");
            dictStates.Add("CO", "Colorado");
            dictStates.Add("CT", "Connecticut");
            dictStates.Add("DE", "Delaware");
            dictStates.Add("FL", "Florida");
            dictStates.Add("GA", "Georgia");
            dictStates.Add("HI", "Hawaii");
            dictStates.Add("IA", "Iowa");
            dictStates.Add("ID", "Idaho");
            dictStates.Add("IL", "Illinois");
            dictStates.Add("IN", "Indiana");
            dictStates.Add("KS", "Kansas");
            dictStates.Add("KY", "Kentucky");
            dictStates.Add("LA", "Louisiana");
            dictStates.Add("MA", "Massachusetts");
            dictStates.Add("MD", "Maryland");
            dictStates.Add("ME", "Maine");
            dictStates.Add("MI", "Michigan");
            dictStates.Add("MN", "Minnesota");
            dictStates.Add("MO", "Missouri");
            dictStates.Add("MS", "Mississippi");
            dictStates.Add("MT", "Montana");
            dictStates.Add("NC", "North Carolina");
            dictStates.Add("ND", "North Dakota");
            dictStates.Add("NE", "Nebraska");
            dictStates.Add("NH", "New Hampshire");
            dictStates.Add("NJ", "New Jersey");
            dictStates.Add("NM", "New Mexico");
            dictStates.Add("NV", "Nevada");
            dictStates.Add("NY", "New York");
            dictStates.Add("OH", "Ohio");
            dictStates.Add("OK", "Oklahoma");
            dictStates.Add("OR", "Oregon");
            dictStates.Add("PA", "Pennsylvania");
            dictStates.Add("RI", "Rhode Island");
            dictStates.Add("SC", "South Carolina");
            dictStates.Add("SD", "South Dakota");
            dictStates.Add("TN", "Tennessee");
            dictStates.Add("TX", "Texas");
            dictStates.Add("UT", "Utah");
            dictStates.Add("VA", "Virginia");
            dictStates.Add("VT", "Vermont");
            dictStates.Add("WA", "Washington");
            dictStates.Add("DC", "Washington DC");
            dictStates.Add("WI", "Wisconsin");
            dictStates.Add("WV", "West Virginia");
            dictStates.Add("WY", "Wyoming");
            return dictStates;
        }
    }
}
